import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/index/following',
    children: [
      {
        path:'/paySuccess',
        component:()=>import('../views/PaySuccess.vue')
      },
      {
        path: '/search',
        component:()=>import('../views/search/SearchView')
      },
      //我的消息-----------------------------------------------------------
      {
        path: '/message',
        component: () => import('../views/MessageView.vue'),
        redirect:'/message/comment',
        children:[{
          path: 'comment',
          component: () => import('../views/message/CommentView.vue'),
        },{
          path: 'likecollect',
          component: () => import('../views/message/LikecollectView.vue'),
        },{
          path: 'fans',
          component: () => import('../views/message/FansView.vue'),
        },{
          path: 'privateletter',
          component: () => import('../views/message/PrivateletterView.vue'),
        },{
          path: 'system',
          component: () => import('../views/message/SystemView.vue'),
        }
        ]
      },
      //个人中心-------------------------------------------------------
      {
        path: '/manage',
        name: 'manage',
        component: () => import('../views/ManageView.vue'),
        redirect:'/manage/profile',
        children: [{
          path: 'profile',
          component: () => import('../views/manage/ProfileView'),
        }]
      },
      //我的主页---------------------------------------------------
      {
        path: '/personal',
        redirect:'/personal/dynamic',
        component: () => import( '../views/PersonalView.vue'),
        children:[{
          path:'dynamic',
          component: () => import( '../views/personal/DynamicView')
        },{
          path:'posts',
          component: () => import( '../views/personal/PostsView')
        },{
          path:'collections',
          component: () => import( '../views/personal/CollectionsView')
        },{
          path:'pins',
          component: () => import( '../views/personal/PinsView')
        },{
          path:'columns',
          component: () => import( '../views/personal/ColumnsView')
        },{
          path:'tags',
          component: () => import( '../views/personal/TagsView')
        }
        ]
      },
      //文章详情---------------------------------------------------
      {
        path: 'detail',
        component: () => import('../views/home/DetailView')
      },
      //首页------------------------------------------------------------------------
      {
        path: '/index',
        component: () => import('../views/home/IndexView'),
        children: [{
          path: 'following',
          component: () => import('../views/right/FollowingView')
        },
          {
            path: '/categoryActive',
            name: 'CategoryActive',
            component: () => import('../views/home/recommended/CategoryActive')
          }]
      }]},
  //创作者中心--------------------------------------------------------
  {
    path: '/',
    name: 'creation',
    children: [
      {
        path: '/creation',
        component: () => import('../views/home/CreationView'),
        redirect: '/creation/home',
        children: [{
          path: 'home',
          component: () => import('../views/creation/HomeView'),
        }
          ,
          {
            path: 'banner',
            component: () => import('../views/creation/BannerView'),
            redirect: '/creation/banner/pass',
            children: [{
              path: 'pass',
              component: () => import('../views/BannerState/PassView'),
            },{
              path: 'audit',
              component: () => import('../views/BannerState/AuditView'),
            }]
          }, {
            path: 'data',
            component: () => import('../views/creation/DataView'),
          }, {
            path: 'ContentData',
            component: () => import('../views/creation/ContentDataView'),
          }, {
            path: 'fansdata',
            component: () => import('../views/creation/FansdataView'),
          }, {
            path: 'cjwenti',
            component: () => import('../views/creation/CJwentiView'),
          }, {
            path: 'wzfabu',
            component: () => import('../views/creation/WZfabuView'),
          }, {
            path: 'czdenji',
            component: () => import('../views/creation/CZdenjiView'),
          }]},
      {
        path: '/text',
        component: () => import('../views/tiaozhuan/text')
      },{
        path: '/text2',
        component:()=>import('../views/tiaozhuan/text2')
      }
    ]
  }
]


const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
